package org.frvi.goldspring.business.service;

import org.frvi.goldspring.business.dao.AccountDao;
import org.frvi.goldspring.business.entity.Account;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Required;
import org.springframework.stereotype.Repository;
import org.springframework.transaction.annotation.Transactional;

/**
 * User: Frank
 * Date: Oct 6, 2009
 * Time: 10:11:16 PM
 */

@Repository("accountService")
@Transactional
public class AccountServiceImpl implements AccountService {

    private AccountDao accountDao;

    public Account save(Account account) {
        return accountDao.save(account);
    }

    public Account findByName(String name) {
        return accountDao.findByName(name);
    }

    public AccountDao getAccountDao() {
        return accountDao;
    }

    @Required @Autowired
    public void setAccountDao(AccountDao accountDao) {
        this.accountDao = accountDao;
    }
}
